From 28c216169ed0d3cd5b727b09e87c05fee2410271 Mon Sep 17 00:00:00 2001 From: "Liu, Jinsong" Date: Sat, 23 Jul 2011 08:55:59 +0100 Subject: [PATCH] acpi: Add support for old and new bios erst, enable mce_apei logic When testing, we found different bios has different understanding about APEI ERST table header, depending on whether it count ACPI standard header or not. This patch add support for both bios version, and enable mce_apei. Signed-off-by: Liu, Jinsong --- xen/arch/x86/cpu/mcheck/Makefile | 2 +- xen/drivers/acpi/apei/erst.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/cpu/mcheck/Makefile b/xen/arch/x86/cpu/mcheck/Makefile index b768bd51c3..36ec89e877 100644 --- a/xen/arch/x86/cpu/mcheck/Makefile +++ b/xen/arch/x86/cpu/mcheck/Makefile @@ -4,7 +4,7 @@ obj-y += amd_k8.o obj-y += amd_f10.o obj-y += mctelem.o obj-y += mce.o -#obj-y += mce-apei.o +obj-y += mce-apei.o obj-y += mce_intel.o obj-y += mce_amd_quirks.o obj-y += non-fatal.o diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c index eb666a6fca..e012cd39e0 100644 --- a/xen/drivers/acpi/apei/erst.c +++ b/xen/drivers/acpi/apei/erst.c @@ -715,7 +715,13 @@ int erst_clear(u64 record_id) static int __init erst_check_table(struct acpi_table_erst *erst_tab) { - if (erst_tab->header_length != sizeof(struct acpi_table_erst)) + /* + * Some old BIOSes include the ACPI standard header in the ERST header + * length; new BIOSes do not. Our check allows for both methods. + */ + if ((erst_tab->header_length != + (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header))) + && (erst_tab->header_length != sizeof(struct acpi_table_erst))) return -EINVAL; if (erst_tab->header.length < sizeof(struct acpi_table_erst)) return -EINVAL; -- 2.30.2